package com.cy.jxc.dao;

import com.cy.jxc.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserSettingDao {
    @Select("select username,password,email from user where username=#{name}")
    User findByUsername(String name);
    //    @Update("update user set password=#{password},email=#{email}  where username=#{name}")
    @Update("update user set username=#{newName} where username=#{name}")
    Integer UpdateUsername(String newName,String name);
    @Update("update user set password=#{password} where  username=#{name}")
    Integer UpdatePsw(String password,String name);
    @Update("update user set email=#{email} where username=#{name}")
    Integer UpdateEmail(String email,String name);
    @Select("select username from user")
    List<String> findAllUsername();
}
